package question1.test2;

import java.util.Scanner;

public class ExceptionDemo2 {
    public static void main(String[] args) {
        String[] arr = {"星期一","星期二","星期三","星期四","星期五","星期六","星期日"};
        Scanner sc=new Scanner(System.in);
        System.out.println("输入一个数");
        int a=sc.nextInt();
        if (a<1||a>7){
            throw new RuntimeException("请输入大于1且小于7的值");
        }else {
            for (int i = 0; i < arr.length; i++) {
                if (a == i + 1) {
                    System.out.println(arr[i]);
                }
            }
        }
    }
}
